#version 330 core

uniform vec3 u_LigthDir;
uniform sampler2DShadow u_TextureDepth;


in vec3 v_Position;
in vec3 v_LocalPosition;
in vec3 v_Normal;
in vec4 v_smCoord;

out vec4 FragColor;








void main(void)
{
	float shadow = textureProj(u_TextureDepth, v_smCoord);
	FragColor = vec4(vec3(max(shadow*dot(v_Normal, -u_LigthDir), 0.0)), 1.0);
	//FragColor = vec4(vec3(shadow), 1);
}